package com.candiq.apps;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.*;
import org.springframework.beans.factory.*;
import com.candiq.beans.*;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.*;

import java.lang.reflect.*;

public class App {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO write my first spring demos using XmlBeanFactory

		/*Resource res = new FileSystemResource("beans.xml");
		BeanFactory factory = new XmlBeanFactory(res);
		HelloworldBean hwBean = (HelloworldBean) factory.getBean("helloworld");
		hwBean.Say();

		HelloWhoBean b2 = (HelloWhoBean) factory.getBean("helloWho");
		b2.Say();*/

		
		
		ApplicationContext context = new FileSystemXmlApplicationContext("beans.xml");
		HelloworldBean hwBean1 = (HelloworldBean) context.getBean("helloworld");
		hwBean1.Say();
		/*HelloWhoBean b2 = (HelloWhoBean) context.getBean("helloWho");
		b2.Say();*/
		AbstractCandiQ candiq  = (AbstractCandiQ) context.getBean("CandiQ");
		System.out.println( candiq.getId());
	}

}
